package cn.kgc.flight.client;

import cn.kgc.flight.pojo.City;
import cn.kgc.flight.pojo.Flight;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "flight-eureka-provider")
public interface RestFlightServiceClient {

    @RequestMapping("/showCity")
    List<City> showAllCity();

    @RequestMapping("/showFlight")
    List<Flight> showFlight(@RequestParam(value = "departureCity") Integer departureCity, @RequestParam(value = "arrivalCity") Integer arrivalCity);

    @RequestMapping("/count")
    Boolean queryCountByFlightNo(@RequestParam(value = "flightNo") String flightNo);

    @RequestMapping("/add")
    Boolean addFlight(@RequestBody Flight flight);

}
